Skip to content

Conversation

@Wyverald
Copy link
Member

@Wyverald Wyverald commented Jan 7, 2026

This is necessary to permit Starlark implementations of ctx.expand_location, which can be more memory efficient, support path mapping and provide better defaults.

RELNOTES: The new package_relative_label function on the rule context (ctx) can be used to turn a user-provided label string into a Label relative to the target that is currently being analyzed (where Label(...) would return a Label relative to the .bzl file containing the call).

Closes #28102.

PiperOrigin-RevId: 853170854
Change-Id: Ibecff3b0b599da0be2fbbba707c15ed540c6c38c

@Wyverald Wyverald requested a review from a team as a code owner January 7, 2026 20:52
@github-actions github-actions bot added team-Configurability platforms, toolchains, cquery, select(), config transitions team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file. awaiting-review PR is awaiting review from an assigned reviewer labels Jan 7, 2026
Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds ctx.package_relative_label, a new Starlark function for rule contexts to convert a string to a Label relative to the currently analyzed target's package. The implementation is sound, documentation is updated, and the new functionality is well-tested. The changes are of high quality.

This is necessary to permit Starlark implementations of `ctx.expand_location`, which can be more memory efficient, support path mapping and provide better defaults.

RELNOTES: The new `package_relative_label` function on the rule context (`ctx`) can be used to turn a user-provided label string into a `Label` relative to the target that is currently being analyzed (where `Label(...)` would return a `Label` relative to the `.bzl` file containing the call).

Closes #28102.

PiperOrigin-RevId: 853170854
Change-Id: Ibecff3b0b599da0be2fbbba707c15ed540c6c38c
@iancha1992 iancha1992 added this pull request to the merge queue Jan 8, 2026
Merged via the queue into release-9.0.0 with commit 2b9e382 Jan 8, 2026
48 checks passed
@github-actions github-actions bot removed the awaiting-review PR is awaiting review from an assigned reviewer label Jan 8, 2026
@Wyverald Wyverald deleted the wyv-900-cprl branch January 8, 2026 19:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

team-Configurability platforms, toolchains, cquery, select(), config transitions team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants